home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / objam01.lha / objam / objc / Object.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-14  |  3.3 KB  |  127 lines

  1. /*
  2. ** ObjectiveAmiga: Interface for the Object class for Objective-C
  3. ** See GNU:lib/libobjam/ReadMe for details
  4. */
  5.  
  6.  
  7. #ifndef __object_INCLUDE_GNU
  8. #define __object_INCLUDE_GNU
  9.  
  10. #include <objc/objc.h>
  11. #include <objc/typedstream.h>
  12.  
  13. /*
  14.  * All classes are derived from Object.  As such,
  15.  * this is the overhead tacked onto those objects.
  16.  */
  17.  
  18. @interface Object
  19. {
  20.   OCClass* isa;           // A pointer to the instance's class structure
  21. }
  22.  
  23.         /* Initializing the class */
  24. + initialize;
  25.  
  26.         /* Creating, copying and freeing instances */
  27. + alloc;
  28. + allocFromZone:(NXZone *)zone; // NeXT only
  29. + new;
  30. - copy;
  31. - copyFromZone:(NXZone *)zone;  // NeXT only
  32. - (NXZone *)zone;               // NeXT only
  33. - free;
  34. - shallowCopy;                  // GNU only
  35. - deepen;                       // GNU only
  36. - deepCopy;                     // GNU only
  37.  
  38.         /* Initializing a new instance */
  39. - init;
  40.  
  41.         /* Identifying classes */
  42. - (OCClass*)class;
  43. - (OCClass*)superclass;   // NeXT only
  44. - (OCClass*)superClass;   // GNU only
  45. - (MetaClass*)metaClass;  // GNU only
  46.  
  47.         /* Identifying and comparing instances */
  48. - (BOOL)isEqual:anObject;
  49. - (unsigned int)hash;
  50. - self;
  51. - (const char *)name;
  52. - (void)printForDebugger;     // NeXT only //-- - (void)printForDebugger:(NXStream *)stream;
  53. - (int)compare:anotherObject; // GNU only
  54.  
  55.         /* Testing object type (GNU only) */
  56. - (BOOL)isMetaClass;  // GNU only
  57. - (BOOL)isClass;      // GNU only
  58. - (BOOL)isInstance;   // GNU only
  59.  
  60.         /* Testing inheritance relationships */
  61. - (BOOL)isKindOf:(OCClass*)aClassObject;
  62. - (BOOL)isKindOfClassNamed:(const char *)aClassName;
  63. - (BOOL)isMemberOf:(OCClass*)aClassObject;
  64. - (BOOL)isMemberOfClassNamed:(const char *)aClassName;
  65.  
  66.         /* Testing class functionality */
  67. - (BOOL)respondsTo:(SEL)aSel;
  68. + (BOOL)instancesRespondTo:(SEL)aSel;
  69.  
  70.         /* Testing for protocol conformance */
  71. - (BOOL)conformsTo:(Protocol*)aProtocol;
  72.  
  73.         /* Sending messages determined at run time */
  74. - perform:(SEL)aSel;
  75. - perform:(SEL)aSel with:anObject;
  76. - perform:(SEL)aSel with:anObject1 with:anObject2;
  77.  
  78.         /* Forwarding messages */
  79. - forward:(SEL)aSel :(arglist_t)argFrame;
  80. - performv:(SEL)aSel :(arglist_t)argFrame;
  81.  
  82.         /* Obtaining method information (GNU calls it 'Introspection') */
  83. - (IMP)methodFor:(SEL)aSel;
  84. + (IMP)instanceMethodFor:(SEL)aSel;
  85. - (struct objc_method_description *)descriptionForMethod:(SEL)aSel;
  86. + (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel;
  87.  
  88.         /* Posing */
  89. + poseAs:(OCClass*)aClassObject;
  90. - (OCClass*)transmuteClassTo:(OCClass*)aClassObject;  // GNU only
  91.  
  92.         /* Enforcing intentions */
  93. - notImplemented:(SEL)aSel;
  94. - subclassResponsibility:(SEL)aSel;
  95. - shouldNotImplement:(SEL)aSel; // GNU only
  96.  
  97.         /* Error handling */
  98. - doesNotRecognize:(SEL)aSel;
  99. - error:(const char *)aString, ...;
  100.  
  101.         /* Dynamic loading (NeXT only) */
  102. //-- + finishLoading;  // NeXT only
  103. //-- + startUnloading; // NeXT only
  104.  
  105.         /* Archiving */
  106. - read: (TypedStream*)aStream;
  107. - write: (TypedStream*)aStream;
  108. //-- + startArchiving;     // NeXT only
  109. - awake;
  110. //-- + finishUnarchiving;  // NeXT only
  111. + setVersion:(int)aVersion;
  112. + (int)version;
  113. + (int)streamVersion: (TypedStream*)aStream;  // GNU only
  114.  
  115. @end
  116.  
  117.  
  118. @interface Object (StepstoneArchiving) // Stepstone only
  119.  
  120. + readFrom:(STR)aFile;
  121. - (BOOL)storeOn:(STR)aFile;
  122.  
  123. @end
  124.  
  125.  
  126. #endif
  127.